package models

import "gorm.io/gorm"

type LiePin struct {
	gorm.Model
	Types         string  `gorm:"type:varchar(20);comment:职位类型"`
	Address       string  `gorm:"type:varchar(50);comment:工作地址"`
	Money         float64 `gorm:"type:decimal(10,2);comment:薪资"`
	Lesson        string  `gorm:"type:varchar(20);comment:工作经验"`
	Qualification string  `gorm:"type:varchar(20);comment:学历"`
}

func (l *LiePin) Create() error {
	return DB.Debug().Create(&l).Error
}
func (l *LiePin) UpdateLiePin() error {
	return DB.Model(&l).Debug().Where("id = ?", l.ID).Updates(&l).Error
}
func (l *LiePin) Delete() error {
	return DB.Model(&l).Debug().Where("id = ?", l.ID).Delete(&l).Error
}
